<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>AyoudaMe | Pages</title>

<!-- start styles css -->

<link type="text/css" href="<?php echo base_url()?>assets/css/base/jquery.ui.all.css" rel="stylesheet" />
<link type="text/css" rel="stylesheet" href="<?php echo base_url()?>assets/css/adminz.styles.css" />
<link type="text/css" rel="stylesheet" href="<?php echo base_url()?>assets/css/grey.styles.css" />
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" />
<link rel="stylesheet" href="<?php echo base_url()?>assets/css/table.styles.css" type="text/css" media="print, projection, screen" />
 <!-- begin chart styles -->
 <link href="<?php echo base_url()?>assets/css/visualize.css" type="text/css" rel="stylesheet" />	
 <link href="<?php echo base_url()?>assets/css/visualize-light.css" type="text/css" rel="stylesheet" /><!-- end chart css -->

 <link rel="stylesheet" href="<?php echo base_url()?>assets/css/jquery.wysiwyg.css" type="text/css" />
 <link rel="stylesheet" type="text/css" media="all" href="<?php echo base_url()?>assets/css/jquery.selectbox.css" />
 
<!--[if IE 8]>
<link type="text/css" rel="stylesheet" href="<?php echo base_url()?>assets/css/ie8.css" />
<![endif]-->
<!--[if IE 7]>
<link type="text/css" rel="stylesheet" href="<?php echo base_url()?>assets/css/ie7.css" />
<![endif]-->
<!-- end styles css -->

<!-- begin javascripts -->
 <script language="javascript" src="<?php echo base_url()?>assets/js/jquery.min.js" type="text/javascript"></script>
 <script src="<?php echo base_url()?>assets/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>
 <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.ui.core.js"></script>
 <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.ui.widget.js"></script>
 <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.ui.mouse.js"></script>
 <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.ui.sortable.js"></script>
 <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.tablesorter.min.js"></script>
 <!-- begin tabs scripts -->
 <script type="text/javascript" src="<?php echo base_url()?>assets/js/chili-1.8b.js"></script>
 <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.cookie.js"></script>
 <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.ui.tabs.js"></script><!-- end tabs scripts -->

 <!-- begin chart scripts -->
 <script type="text/javascript" src="<?php echo base_url()?>assets/js/excanvas.js"></script>	
 <script type="text/javascript" src="<?php echo base_url()?>assets/js/visualize.jquery.js"></script><!-- end chart scripts -->
 
 <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.wysiwyg.js"></script>
 <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.selectbox-0.6.1.js"></script>
 <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.ui.datepicker.js"></script>
 <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.ui.progressbar.js"></script>
 <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.ui.slider.js"></script>
 <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.scrollbar.js"></script>
 <script type="text/javascript" src="<?php echo base_url()?>assets/js/jquery.custom.js"></script>
<script type="text/javascript">
//subnav top menu
$(document).ready(function(){
						   
	$("#top_menu_content li a").hover(function() { //When trigger is clicked...
		
		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){	
			$(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() { 
			$(this).addClass("subhover");//On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover");//On hover out, remove class "subhover"
	});

});
	$(function() {
		$("#tabs").tabs({
			cookie: {
				// store cookie for a day, without, it would be a session cookie
				expires: 1
			}
		});
	});
	</script><!-- end javascripts -->
    
</head>

<body>
<?php 
$this->lang->load('user_pages', $language);

//User general Information
    $userName                       = ''; 
    $userEmail                      = '';
    $userPseudo                     = '';
    $useravatar                     = '';
    $userLocation                   = '';
    $userHasPage                    = '';

//Pages general Information
    $page_title     = '';
    $keywords       = ''; 
    $page_title     = '';
    $nbr_cases      = '';
    $prix_case      = '';
    $page_description    = '';
    $short_page_description = '';
    $sommeTotal = $prix_case * $nbr_cases

    
//Settings Information    
?>
<?php 
//User general Information
    if (isset ($userInfo)):  foreach($userInfo as $row): 
        $userName           = $row->user_name;    
        $userEmail          = $row->user_email;
        $userPseudo         = $row->user_pseudo;
        $useravatar         = $row->user_avatar;
        $userLocation       = $row->user_location;
        $userHasPage        = $row->user_has_page;
     endforeach;
     endif; 
 ?>
<?php 
//Pages general Information
/*
        $page_title       = $row->title_page; 
        $nbr_cases        = $row->nbr_cases_page; 
        $prix_case        = $row->prix_case_page;
        $page_description = $row->description_page; 
        $keywords         = $row->keywords_page; 
        $page_id          = $row->id_page; 
        $is_active        = $row->isactive_page;
        $page_deadline    = $row->date_limite_page;
        $cases_purchased  = $row->nbr_cases_earned_page;
        $short_page_description = $row->short_description_page;
 */
 ?>

    
    
<!-- start top menu -->
<div id="top_menu">
<div id="top_menu_content">

<!-- start logo -->
<img src="<?php echo base_url()?>assets/img/adminz/logo.png" width="160" height="42" alt="adminz" class="float_left margin_10_0" /><!-- end logo -->

<!-- start menu -->
<ul>
    <li><?php echo anchor('user','Dashboard');?></li>
    <li class="current"><?php echo anchor('#','Pages');?>
        <ul class="subnav">
            <li><?php echo anchor('user/pages/create_new','New Page');?></li>
        </ul>
    </li>
    <li><?php echo anchor('user/donations','Donations');?></li>
    <li><?php echo anchor('user/settings','Settings');?></li>
    <li><?php echo anchor('user/help','Help');?></li>
</ul><!-- end menu -->

<div class="float_right margin_0_20">
	<a href="dashboard.html"><img src="<?php echo base_url()?>assets/img/adminz/settings.png" width="24" height="24" alt="settings" /></a><br />
	<a href="../../user/logout"><img src="<?php echo base_url()?>assets/img/adminz/logout.png" width="24" height="24" alt="logout" /></a>
</div>
		<div id="top_menu_info">
			<img src="<?php echo base_url()?>assets/img/adminz/avatar.png" width="32" height="32" alt="avatar" /><br />
			Hello, <?php echo $userName ?></div>
		</div>
	<div id="top_menu_button" class="down_arrow corners_bottom">&nbsp;</div>
</div><!-- end top menu -->

<!-- start container -->
<div class="container">
<!-- start column -->
<div class="column">
    
        <!-- if page is created successfully -->
        <?php if (isset ($created_success) && $created_success == '1'){ ?>
            <div>
                // @TODO: remplacer le lien a href par un anchor
                <a href="javascript:();" title="Succes box" class="box succes corners"><span class="close">&nbsp;</span><?php echo $this->lang->line('page_created_success'). anchor('user/pages', $this->lang->line('manage_pages')) ?></a>
            </div>
        <?php } ?>
    <!-- end if page is created successfully -->        
    
        <!-- start forms panel -->
	<div class="panel corners">
        <!-- start title -->
        <div class="title corners_top"><h6 id="forms"><?php echo $this->lang->line('add_new_page'); ?></h6></div><!-- end title -->
        
        <!-- start content -->
        <div class="content">
            <?php echo form_fieldset($this->lang->line('page_information')); ?>
                <?php 
                    $form_attributes = array('id' => 'pageForm');
                    echo form_open_multipart('user/pages/create_new', $form_attributes);  
                ?>
                           
        <?php echo form_label($this->lang->line('form_page_title'), 'page_title'); ?><br />
        
            <?php 
                $input_data = array ('name' => 'page_title' , 'value' => set_value("page_title"), 'class' => 'small_input corners');
                echo form_input($input_data);
            ?>
<br />
                <div class="nodisplay" id="nameInfo"></div>
        <?php echo form_label($this->lang->line('form_page_short_description'), 'short_description'); ?><br />        
            <?php 
                $input_data = array ('name' => 'short_description' , 'value' => set_value("short_description"), 'class' => 'large_input corners');
                echo form_input($input_data );
            ?><br /><br />
		<?php echo form_label($this->lang->line('form_page_long_description'), 'long_description'); ?><br /> 
            <?php 
                $input_data = array ('name' => 'long_description' , 'value' => set_value("long_description"), 'id' => 'wysiwyg', 'cols' =>'100');
                echo form_textarea($input_data);
            ?><br /><br />
		<?php echo form_label($this->lang->line('form_page_keywords'), 'keywords'); ?><br />        
            <?php 
                $input_data = array ('name' => 'keywords' , 'value' => set_value("keywords"), 'class' => 'small_input corners');
                echo form_input($input_data );
            ?><br /><br />
                <?php echo form_label($this->lang->line('form_page_nbr_cases'), 'nbr_cases'); ?><br />        
            <?php 
                $input_data = array ('name' => 'nbr_cases' , 'value' => set_value("nbr_cases"), 'class' => 'tiny_input corners');
                echo form_input($input_data );
            ?><br /><br />
                <?php echo form_label($this->lang->line('form_page_price_case'), 'prix_case'); ?><br />        
            <?php 
                $input_data = array ('name' => 'prix_case', 'value' => set_value("prix_case"), 'class' => 'tiny_input corners');
                echo form_input($input_data).'€';
            ?><br /><br />
                <?php echo form_label($this->lang->line('form_page_deadline'), 'deadline'); ?><br />        
            <?php 
                $input_data = array ('name' => 'deadline' , 'value' => set_value("deadline"), 'class' => 'tiny_input corners', 'id' =>'checkin');
                echo form_input($input_data);
            ?><br /><br />                        
                <?php echo form_label($this->lang->line('form_page_header'), 'userfile'); ?><br />
            <?php 
                $input_data = array ('name' => 'prix_case' , 'class' => 'tiny_input corners', 'id' =>'checkin');
                ?>
                <input type="text" id="fileName" class="file_input_textbox corners_left" readonly="readonly" />
                <div class="file_input_div">
                        <input type="button" value="" class="file_input_button" />
                        <input type="file" name="userfile" class="file_input_hidden" onchange="javascript: document.getElementById('fileName').value = this.value" />
                </div>                
            <br />                        		
            <?php

                if (isset($error_avatar_upload)) echo '<div><a href="javascript:();" title="Error box" class="box error corners"><span class="close">&nbsp;</span>'.$error_avatar_upload.'</a></div>' ;
                if (isset($success_avatar_upload)) echo '<div><a href="javascript:();" title="Succes box" class="box succes corners"><span class="close">&nbsp;</span>'.$success_avatar_upload.'</a></div>';  
            ?>
            
            <?php 
                $input_data = array ('name' => 'submit' , 'value' => 'Create Page', 'class' => 'button btn_medium');
                echo form_submit($input_data);
            ?>    
            <?php echo validation_errors('<div class="info_error" id="passInfo"><p>'); ?>

		
<?php echo form_fieldset_close(); ?>

        </div><!--end content-->
            
        </div>

    
</div><!-- end column -->

<div class="clear"></div>

<!-- begin footer -->
    <?php $this->load->view('modules/footer.php'); ?>
<!-- end footer -->


</div><!-- end container -->

<!-- begin fixed left panel -->
<div class="fixed_left_panel corners_right">
	<div class="hidden_left_div">
		<ul class="list_left">
			<li><a href="javascript:();">5 new orders</a></li>
			<li><a href="javascript:();">2 new comments</a></li>
			<li><a href="javascript:();">1 system error</a></li>
			<li><a href="javascript:();">1 new message</a></li>
			<li><a href="javascript:();">8 new subscribers</a></li>
			<li><a href="javascript:();">4 new articles</a></li>
			<li><a href="javascript:();">2 new topics</a></li>
			<li><a href="javascript:();">6 new posts</a></li>
		</ul></div>
	<div class="show_left_div right_arrow"></div>
<div class="clear"></div></div><!-- end fixed left panel -->

	<!-- begin fixed right panel -->
	<div class="fixed_right_panel fixed_right_panel_hide corners_left">
		<div class="hidden_right_div">
			<div class="date float_left">19 / July / 2010</div>
            <div class="time float_left">18:06</div>
            <div class="clear"></div>
            <div class="all_appointments"><a href="javascript:();">View all appointments</a></div>
            <div class="today_appointments">No appointments today</div>
			<div id="appointments"></div>
		</div>
	<div class="show_right_div left_arrow"></div>
	  <div class="clear"></div>
	</div><!-- end fixed right panel -->

</body>
</html>
